package com.log.com.log.bean;

import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
 
/**
 * 删除日志功能的bean 
 * @author dell
 *
 */
public class DeleLogBean {

	/**
	 * 临时保存的日志文件  方便进行删除操作
	 */
	private ArrayList<File> file=new ArrayList<File>();
	
	/**
	 * 临时监控文件的大小
	 */
	private Long totalSize=0l;
	
	/**
	 * 需要监控的日志文件列表
	 */
	private  ArrayList<File> logFile=new ArrayList<File>();
	
	/**
	 * 日志文件监控时间 单位毫秒  默认是60000毫秒 
 	 */ 
	private  int logCheckTime=60000;

	/**
	 * 日志文件size的最大值 单位千字节 
	 */
	private long totalLogSize=2*1024*1024;

	/**
	 * 日志默认保存天数
	 */
	private int keepMaxDayLog=10;
	
	/**
	 * 日志保存文件最长时间 单位ms 
	 */
	private int maxLogFileKeepTime=360000000;

	public ArrayList<File> getFile() {
		return file;
	}

	public void setFile(ArrayList<File> file) {
		this.file = file;
	}

	public Long getTotalSize() {
		return totalSize;
	}

	public void setTotalSize(Long totalSize) {
		this.totalSize = totalSize;
	}

	public ArrayList<File> getLogFile() {
		return logFile;
	}

	public void setLogFile(ArrayList<File> logFile) {
		this.logFile = logFile;
	}

	public int getLogCheckTime() {
		return logCheckTime;
	}

	public void setLogCheckTime(int logCheckTime) {
		this.logCheckTime = logCheckTime;
	}

	public long getTotalLogSize() {
		return totalLogSize;
	}

	public void setTotalLogSize(long totalLogSize) {
		this.totalLogSize = totalLogSize;
	}

	public int getKeepMaxDayLog() {
		return keepMaxDayLog;
	}

	public void setKeepMaxDayLog(int keepMaxDayLog) {
		this.keepMaxDayLog = keepMaxDayLog;
		this.maxLogFileKeepTime=this.keepMaxDayLog*24*60*60*1000;
	}

	public int getMaxLogFileKeepTime() {
		return maxLogFileKeepTime;
	}

	public void setMaxLogFileKeepTime(int maxLogFileKeepTime) {
		this.maxLogFileKeepTime = maxLogFileKeepTime;
	}
	
	/**
	 * 增加检测的日志文件目录
	 * @param file
	 */
	public void addPath(String file){
		this.logFile.add(new File(file));
	}
	
	/**
	 * 批量增加被检测的日志文件目录
	 * @param file
	 */
	public void addAllPath(Collection<String> file){
		for(String path:file){
			this.logFile.add(new File(path));
		}
	}
}
